from flask import Flask,current_app

app = Flask(__name__)


app.logger.debug('this is a debug')
app.logger.error('this is a system error')
app.logger.warning('this is a warning')

with app.test_request_context():
    current_app.logger.debug('this is a debug')
    current_app.logger.error('this is a system error')
    current_app.logger.warning('this is a warning')